Skip to content

Add choropleth support to GeoAxes#623

Merged
cvanelteren merged 9 commits intoUltraplot:mainfrom
cvanelteren:feat/choropleth-622
Mar 19, 2026
Merged

Add choropleth support to GeoAxes#623
cvanelteren merged 9 commits intoUltraplot:mainfrom
cvanelteren:feat/choropleth-622

Conversation

@cvanelteren
Copy link
Collaborator

@cvanelteren cvanelteren commented Mar 19, 2026

Add a first-class GeoAxes.choropleth API for polygon geometries and country-keyed values, including colorbar integration, missing-value styling, documentation examples, and targeted geographic tests. Closes #622.

@cvanelteren cvanelteren requested a review from Copilot March 19, 2026 03:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a first-class GeoAxes.choropleth API for coloring polygon geometries (including country-keyed inputs) and integrates it with UltraPlot’s colormap/colorbar pipeline, along with docs examples and geographic tests (closes #622).

Changes:

  • Implement GeoAxes.choropleth() plus supporting geometry projection/path helpers in ultraplot/axes/geo.py.
  • Add targeted choropleth tests for collections, missing-value styling, country resolution, zorder, and validation errors.
  • Add documentation examples demonstrating polygon- and country-based choropleths.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
ultraplot/axes/geo.py Introduces GeoAxes.choropleth() and helper utilities for projecting shapely polygon rings into backend coordinates and producing PatchCollections.
ultraplot/tests/test_geographic.py Adds unit tests covering choropleth rendering behavior, country-identifier resolution, zorder defaults, and input validation.
docs/projections.py Adds a new projections guide snippet demonstrating polygon choropleth usage with colorbar formatting.
docs/examples/geo/04_choropleth.py Adds a standalone documentation example for country-keyed choropleths with missing-value styling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@cvanelteren cvanelteren requested a review from gepcel March 19, 2026 04:46
@gepcel
Copy link
Collaborator

gepcel commented Mar 19, 2026

From the example, the edgecolor="white" seems having no effect.

@cvanelteren
Copy link
Collaborator Author

cvanelteren commented Mar 19, 2026

That is a z-order issue let me fix that. The choropleth shapes are drawn on top of the existing geometries.

@cvanelteren
Copy link
Collaborator Author

cvanelteren commented Mar 19, 2026

image should be good

@cvanelteren cvanelteren merged commit dba5f4e into Ultraplot:main Mar 19, 2026
17 checks passed
@cvanelteren cvanelteren deleted the feat/choropleth-622 branch March 19, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: add choropleth support to GeoAxes

3 participants